const state = {
  songList: [], // 歌单歌曲页面
  cover: null, // 榜单歌曲封面
  title: '' // 榜单歌曲标题
}

const actions = {
  async getSongList({ commit }, songId) {
    const res = await this._vm.$API.songList.reqGetSongList(songId)
    commit('SAVE_SONG_LIST', res.data.musicList)
  }
}

const mutations = {
  SAVE_SONG_LIST(state, data) {
    state.songList = data
  },
  SAVE_SONG_INFO(state, info) {
    state.cover = info.img
    state.title = info.name
  }
}

const getters = {}

export default {
  namespaced: true,
  state,
  actions,
  mutations,
  getters
}
